package com.aatattoo.light_food_service.service;

import com.aatattoo.light_food_service.entity.MappingTag;
import com.aatattoo.light_food_service.mapper.MappingTagMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author aatattoo
 * @Date 2021/12/9 9:40 下午
 * @msg:
 */
@Service
@Component
public class MappingTagService {
    @Autowired
    private MappingTagMapper mappingTagMapper;

    public int addMappingTag(MappingTag mappingTag){
        return mappingTagMapper.addMappingTag(mappingTag);
    }

    public List<MappingTag> findAllByDynamicId(int dynamicId){
        return mappingTagMapper.findAllByDynamicId(dynamicId);
    }

    public int getIdByTag(MappingTag mappingTag){
        return mappingTagMapper.getIdByTag(mappingTag);
    }

    public int deleteMappingById(int id){
        return mappingTagMapper.deleteMappingById(id);
    }

    public int deleteByDynamicId(int dynamicId){
        return mappingTagMapper.deleteByDynamicId(dynamicId);
    }

    public int updataMappingOrder(MappingTag mappingTag){
        return mappingTagMapper.updataMappingOrder(mappingTag);
    }

    public List<Integer> getRelevantDynamicId(int tagId){
        return mappingTagMapper.getRelevantDynamicId(tagId);
    }
}
